import request from '@/utils/request'

// 查询进项发票列表
export function listInvoice(query) {
  return request({
    url: '/doc/inInvoice/list',
    method: 'get',
    params: query
  })
}

// 查询抵扣进项发票列表
export function listDeductionInvoice(query) {
  return request({
    url: '/doc/inInvoice/listDeduction',
    method: 'get',
    params: query
  })
}

// 根据税期查询进项发票
export function getInvoiceListByPeriod(period) {
  return request({
    url: '/doc/inInvoice/invoiceListByPeriod/' + period,
    method: 'get',
  })
}

// 查询进项发票详细
export function getInvoice(invoiceId) {
  return request({
    url: '/doc/inInvoice/' + invoiceId,
    method: 'get'
  })
}

// 新增进项发票
export function addInvoice(data) {
  return request({
    url: '/doc/inInvoice',
    method: 'post',
    data: data
  })
}

// 修改进项发票
export function updateInvoice(data) {
  return request({
    url: '/doc/inInvoice',
    method: 'put',
    data: data
  })
}

// 删除进项发票
export function delInvoice(invoiceId) {
  return request({
    url: '/doc/inInvoice/' + invoiceId,
    method: 'delete'
  })
}


// 进项发票勾选抵扣
export function deductionApply(invoiceId) {
  return request({
    url: '/doc/inInvoice/deductionApply/' + invoiceId,
    method: 'get'
  })
}


// 进项发票取消勾选抵扣
export function deductionApplyCancel(invoiceId) {
  return request({
    url: '/doc/inInvoice/deductionApplyCancel/' + invoiceId,
    method: 'get'
  })
}


// 进项发票勾选不抵扣
export function deductionCancelnonApply(params) {
  return request({
    url: '/doc/inInvoice/deductionCancelnonApply',
    params: params,
    method: 'get'
  })
}


// 进项发票取消勾选不抵扣
export function deductionCancelnonApplyCancel(invoiceId) {
  return request({
    url: '/doc/inInvoice/deductionCancelnonApplyCancel/' + invoiceId,
    method: 'get'
  })
}

